package com.unknow.first.dapp.admin.account.service;

import com.unknow.first.dapp.admin.account.mapper.AddressWithdraw;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;

/**
 * 提现额外处理器
 */
public interface WithdrawHandlerInterface {

    /**
     * 获取用户名
     * @param address
     * @return
     */
    String getUsername(String address);

    @Transactional(rollbackFor = Exception.class, propagation = Propagation.MANDATORY)
    void doBefore(final String address, Integer coinId, final BigDecimal originAmount) throws Exception;

    @Transactional(rollbackFor = Exception.class, propagation = Propagation.MANDATORY)
    void doAfter(final AddressWithdraw addressWithdraw) throws Exception;

}
